{include file="layout/head.tpl"}

{literal}

<script type="text/javascript" src="include/js/funcoes.js"></script>

<script type="text/javascript">

$().ready(function() {
    
    $('#stepForm').submit(function() {

        var step = $("#step").val();
        var janelaModal = abrirModalCarregando('Salvando Passo '+step);

        $(this).ajaxSubmit({
            success : function(responseText, statusText, xhr, $form){                
                $('#stepDiv').html(responseText);
                if(step == 8)
                    $("button[type=submit]").hide(1500);
                        
                janelaModal.closeModal();
            }
        });         
        return false;
    });
        
    $(".prevStep").click(function(){
        var step = $("#step").val()-1;
        if(step > 0){
            var janelaModal = abrirModalCarregando('Carregando Passo '+step+'...');
            $('#stepDiv').load('GeneratorAction.loadStep',
                {step:step}, 
                function(){
                    $("button[type=submit]").show(1500);
                    janelaModal.closeModal();                    
                }
            );
        }
    });    

});
    



</script>

{/literal}

<!-- the 'special-page' class is only an identifier for scripts -->
<body class="special-page wizard-bg">
<!-- The template uses conditional comments to add wrappers div for ie8 and ie7 - just add .ie, .ie7 or .ie6 prefix to your css selectors when needed -->
<!--[if lt IE 9]><div class="ie"><![endif]-->
<!--[if lt IE 8]><div class="ie7"><![endif]-->

    <div class="block-border" style="margin: 15px">
        <form class="block-content form inline-medium-label" name="stepForm" id="stepForm"
              method="post" action="GeneratorAction.nextStep">

            <h1>BloumGenerator -> {$projectName|default:''}</h1>

            <p style="text-align:right;">
                <button type="button" class="grey prevStep">Voltar</button>    
                <button type="submit">Avançar</button>                           
            </p>


            <div id="stepDiv">                        
                {include file="steps/step1.tpl"}
            </div>

            <br />
            <p style="text-align:right;">
                <button type="button" class="grey prevStep">Voltar</button>    
                <button type="submit">Avançar</button>                           
            </p>

        </form>
    </div>

<!--[if lt IE 8]></div><![endif]-->
<!--[if lt IE 9]></div><![endif]-->
</body>

{include file="layout/footer.tpl"}